package com.yonyou.cms.epc.client.dto.shoppingCart;

import com.yonyou.cms.epc.client.dto.BaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @description: 购物车DTO对象
 * @author: chengbufang
 * @date: 2022-06-29 14:46
 */
public class ShoppingCartDTO extends BaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 备件编码
     */
    private String partCode;

    /**
     * 备件名称
     */
    private String partName;

    /**
     * 单价(元)
     */
    private BigDecimal partPrice;

    /**
     * 数量
     */
    private Integer partCount;

    /**
     * APP_ID
     */
    private String appId;

    /**
     * 图片路径
     */
    private String partPic;

    /**
     * 创建人
     */
    private String createdBy;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPartCode() {
        return partCode;
    }

    public void setPartCode(String partCode) {
        this.partCode = partCode;
    }

    public String getPartName() {
        return partName;
    }

    public void setPartName(String partName) {
        this.partName = partName;
    }

    public BigDecimal getPartPrice() {
        return partPrice;
    }

    public void setPartPrice(BigDecimal partPrice) {
        this.partPrice = partPrice;
    }

    public Integer getPartCount() {
        return partCount;
    }

    public void setPartCount(Integer partCount) {
        this.partCount = partCount;
    }

    @Override
    public String getAppId() {
        return appId;
    }

    @Override
    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getPartPic() {
        return partPic;
    }

    public void setPartPic(String partPic) {
        this.partPic = partPic;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author wangyan
     * @since 2019-09-21
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author wangyan
     * @since 2019-09-21
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "id");
    }
}
